namespace UniversalAdminSystem.Domian.PermissionManagement.ValueObjects;

public record RoleName
{
    public string Value { get; private set; }
    private RoleName(string value)
    {
        if (string.IsNullOrWhiteSpace(value))
            throw new ArgumentException("角色名称不能为空");
        if (value.Length > 50)
            throw new ArgumentException("角色名称不能超过50个字符");
        Value = value;
    }
    public static RoleName Create(string value) => new(value);

    public static explicit operator RoleName(string value) => Create(value);
    public static implicit operator string(RoleName name) => name.Value;
} 